( gsos )

$e100a8 constant gsos-inline
$e100b0 constant gsos-stack

: gsos ( callnum "" -- )
  1 0 const-does> ( parmblock -- )
    gsos-inline @al jsl,
    t2, a4, ;

( strings )

: gsosInputString>length ;
: gsosInputString>data $0002 + ;

: gsosOutputString>max ;
: gsosOutputString>length $0002 + ;
: gsosOutputString>data   $0004 + ;

( filetypes )

$005a constant CFGfiletype

( calls )

$2034 gsos AddNotifyProcGS

struct
  word% field AddNotifyProc>pCount      \ min 1
  long% field AddNotifyProc>procPointer \ in
end-struct AddNotifyProc%

$201d gsos BeginSessionGS

struct
  word% field BeginSession>pCount \ min 0
end-struct BeginSession%

$2031 gsos BindIntGS

struct
  word% field BindInt>pCount  \ min 3
  word% field BindInt>intNum  \ out
  word% field BindInt>vrn     \ in
  long% field BindInt>intCode \ in
end-struct BindInt%

$2004 gsos ChangePathGS

struct
  word% field ChangePath>pCount      \ min 2
  long% field ChangePath>pathname    \ in
  long% field ChangePath>newPathname \ in
end-struct CahngePath%

$200b gsos ClearBackupBitGS

struct
  word% field ClearBackupBit>pCount   \ min 1
  long% field ClearBackupBit>pathname \ in
end-struct ClearBackupBit%

$2014 gsos CloseGS

struct
  word% field Close>pCount \ min 1
  word% field Close>refNum \ in
end-struct Close%

$2001 gsos CreateGS

struct
  word% field Create>pCount      \ min 1
  long% field Create>pathname    \ in
  word% field Create>access      \ in
  word% field Create>fileType    \ in
  long% field Create>auxType     \ in
  word% field Create>storageType \ in
  long% field Create>eof         \ in
  long% field Create>resourceEOF \ in
end-struct Create%

$202e gsos DControlGS

struct
  word% field DControl>pCount        \ min 5
  word% field DControl>devNum        \ in
  word% field DControl>code          \ in
  long% field DControl>list          \ in
  long% field DControl>requestCount  \ in
  long% field DControl>transferCount \ out
end-struct DControl%

$2035 gsos DelNotifyProcGS

struct
  word% field DelNotifyProc>pCount      \ min 1
  long% field DelNotifyProc>procPointer \ in
end-struct DelNotifyProc%

$2002 gsos DestroyGS

struct
  word% field Destroy>pCount   \ min 1
  long% field Destroy>pathname \ in
end-struct Destroy%

$202c gsos DInfoGS

struct
  word% field DInfo>pCount          \ min 2
  word% field DInfo>devNum          \ in
  long% field DInfo>devName         \ in
  word% field DInfo>characteristics \ out
  long% field DInfo>totalBlocks     \ out
  word% field DInfo>slotNum         \ out
  word% field DInfo>unitNum         \ out
  word% field DInfo>version         \ out
  word% field DInfo>deviceID        \ out
  word% field DInfo>headLink        \ out
  word% field DInfo>forwardLink     \ out
  long% field DInfo>extendedDIBptr  \ in
end-struct DInfo%

$202f gsos DReadGS

struct
  word% field DRead>pCount        \ min 6
  word% field DRead>devNum        \ in
  long% field DRead>buffer        \ in
  long% field DRead>requestCount  \ in
  long% field DRead>startingBlock \ in
  word% field DRead>blockSize     \ in
  long% field DRead>transferCount \ out
end-struct DRead%

$2036 gsos DRenameGS

struct
  word% field DRename>pCount \ min 2
  word% field DRename>devNum \ in
  long% field DRename>strPtr \ in
end-struct DRename%

$202d gsos DStatusGS

struct
  word% field DStatus>pCount        \ min 5
  word% field DStatus>devNum        \ in
  word% field DStatus>code          \ in
  long% field DStatus>list          \ in
  long% field DStatus>requestCount  \ in
  long% field DStatus>transferCount \ out
end-struct DStatus%

$2030 gsos DWriteGS

struct
  word% field DWrite>pCount        \ min 6
  word% field DWrite>devNum        \ in
  long% field DWrite>buffer        \ in
  long% field DWrite>requestCount  \ in
  long% field DWrite>startingBlock \ in
  word% field DWrite>blockSize     \ in
  long% field DWrite>transferCount \ out
end-struct DWrite%

$201e gsos EndSessionGS

struct
  word% field EndSession>pCount \ min 0
end-struct EndSession%

$2025 gsos EraseDiskGS

struct
  word% field EraseDisk>pCount       \ min 3
  long% field EraseDisk>devName      \ in
  long% field EraseDisk>volName      \ in
  word% field EraseDisk>fileSysID    \ out
  word% field EraseDisk>reqFileSysID \ in
end-struct EraseDisk%

$200e gsos ExpandPathGS

struct
  word% field ExpandPath>pCount     \ min 2
  long% field ExpandPath>inputPath  \ in
  long% field ExpandPath>outputPath \ in
  word% field ExpandPath>flags      \ in
end-struct ExpandPath%

$2015 gsos FlushGS

struct
  word% field Flush>pCount \ min 1
  word% field Flush>refNum \ in
end-struct Flush%

$2024 gsos FormatGS

struct
  word% field Format>pCount       \ min 3
  long% field Format>devName      \ in
  long% field Format>volName      \ in
  word% field Format>fileSysID    \ out
  word% field Format>reqFileSysID \ in
end-struct Format%

$2033 gsos FSTSpecificGS

struct
  word% field FSTSpecific>pCount     \ min 1
  word% field FSTSpecific>fileSysID  \ in
  word% field FSTSpecific>commandNum \ in
end-struct FSTSpecific%

$2028 gsos GetBootVolGS

struct
  word% field GetBootVol>pCount     \ min 1
  long% field GetBootVol>dataBuffer \ in
end-struct GetBootVol%

$2020 gsos GetDevNumberGS

struct
  word% field GetDevNumber>pCount  \ min 2
  long% field GetDevNumber>devName \ in
  word% field GetDevNumber>devNum  \ out
end-struct GetDevNumber%

$201c gsos GetDirEntryGS

struct
  word% field GetDirEntry>pCount         \ min 5
  word% field GetDirEntry>refNum         \ in
  word% field GetDirEntry>flags          \ out
  word% field GetDirEntry>base           \ in
  word% field GetDirEntry>displacement   \ in
  long% field GetDirEntry>name           \ in
  word% field GetDirEntry>entryNum       \ out
  word% field GetDirEntry>fileType       \ out
  long% field GetDirEntry>eof            \ out
  long% field GetDirEntry>blockCount     \ out
  quad% field GetDirEntry>createDateTime \ out
  quad% field GetDirEntry>modDatetime    \ out
  word% field GetDirEntry>access         \ out
  long% field GetDirEntry>auxType        \ out
  word% field GetDirEntry>fileSysID      \ out
  long% field GetDirEntry>optionList     \ in
  long% field GetDirEntry>resourceEOF    \ out
  long% field GetDirEntry>resourceBlocks \ out
end-struct GetDirEntry%

$2019 gsos GetEOFGS

struct
  word% field GetEOF>pCount \ min 2
  word% field GetEOF>refNum \ in
  long% field GetEOF>eof    \ out
end-struct GetEOF%

$2006 gsos GetFileInfoGS

struct
  word% field GetFileInfo>pCount         \ min 2
  long% field GetFileInfo>pathname       \ in
  word% field GetFileInfo>access         \ out
  word% field GetFileInfo>fileType       \ out
  long% field GetFileInfo>auxType        \ out
  word% field GetFileInfo>storageType    \ out
  quad% field GetFileInfo>createDateTime \ out
  quad% field GetFileInfo>modDateTime    \ out
  long% field GetFileInfo>optionList     \ in
  long% field GetFileInfo>eof            \ out
  long% field GetFileInfo>blocksUsed     \ out
  long% field GetFileInfo>resourceEOF    \ out
  long% field GetFileInfo>resourceBlocks \ out
end-struct GetFileInfo%

$202b gsos GetFSTInfoGS

struct
  word% field GetFSTInfo>pCount      \ min 2
  word% field GetFSTInfo>fstNum      \ in
  word% field GetFSTInfo>fileSysID   \ out
  long% field GetFSTInfo>fstName     \ in
  word% field GetFSTInfo>version     \ out
  word% field GetFSTInfo>attributes  \ out
  word% field GetFSTInfo>blockSize   \ out
  long% field GetFSTInfo>maxVolSize  \ out
  long% field GetFSTInfo>maxFileSize \ out
end-struct GetFSTInfo%

$201b gsos GetLevelGS

struct
  word% field GetLevel>pCount \ min 1
  word% field GetLevel>level  \ out
end-struct GetLevel%

$2017 gsos GetMarkGS

struct
  word% field GetMark>pCount   \ min 2
  word% field GetMark>refNum   \ in
  long% field GetMark>position \ out
end-struct GetMark%

$2027 gsos GetNameGS

struct
  word% field GetName>pCount     \ min 1
  long% field GetName>dataBuffer \ in
end-struct GetName%

$200a gsos GetPrefixGS

struct
  word% field GetPrefix>pCount    \ min 2
  word% field GetPrefix>prefixNum \ in
  long% field GetPrefix>prefix    \ in
end-struct GetPrefix%

$2039 gsos GetRefInfoGS

struct
  word% field GetRefInfo>pCount   \ min 2
  word% field GetRefInfo>refNum   \ in
  word% field GetRefInfo>access   \ out
  long% field GetRefInfo>pathname \ in
end-struct GetRefInfo%

$2038 gsos GetRefNumGS

struct
  word% field GetRefNum>pCount       \ min 2
  long% field GetRefNum>pathname     \ in
  word% field GetRefNum>refNum       \ out
  word% field GetRefNum>access       \ out
  word% field GetRefNum>resNum       \ in
  word% field GetRefNum>caseSense    \ in
  word% field GetRefNum>displacement \ in
end-struct GetRefNum%

$2037 gsos GetStdRefNumGS

struct
  word% field GetStdRefNum>pCount    \ min 2
  word% field GetStdRefNum>prefixNum \ in
  word% field GetStdRefNum>refNum    \ out
end-struct GetStdRefNum%

$200f gsos GetSysPrefsGS

struct
  word% field GetSysPrefs>pCount      \ min 1
  word% field GetSysPrefs>preferences \ out
end-struct GetSysPrefs%

$202a gsos GetVersionGS

struct
  word% field GetVersion>pCount  \ min 1
  word% field GetVersion>version \ out
end-struct GetVersion%

$2011 gsos NewLineGS

struct
  word% field NewLine>pCount       \ min 4
  word% field NewLine>refNum       \ in
  word% field NewLine>enableMask   \ in
  word% field NewLine>numChars     \ in
  long% field NewLine>newlineTable \ in
end-struct NewLine%

$200d gsos NullGS

struct
  word% field Null>pCount \ min 0
end-struct Null%

$2010 gsos OpenGS

struct
  word% field Open>pCount         \ min 2
  word% field Open>refNum         \ out
  long% field Open>pathname       \ in
  word% field Open>requestAccess  \ in
  word% field Open>resourceNumber \ in
  word% field Open>access         \ out
  word% field Open>fileType       \ out
  long% field Open>auxType        \ out
  word% field Open>StorageType    \ out
  quad% field Open>createDateTime \ out
  quad% field Open>modDateTime    \ out
  long% field Open>optionList     \ in
  long% field Open>eof            \ out
  long% field Open>blocksUsed     \ out
  long% field Open>resourceEOF    \ out
  long% field Open>resourceBlocks \ out
end-struct Open%

$2003 gsos OSShutdownGS

struct
  word% field OSShutdown>pCount       \ min 1
  word% field OSShutdown>shutdownFlag \ in
end-struct OSShutdown%

$2029 gsos QuitGS

struct
  word% field Quit>pCount   \ min 0
  long% field Quit>pathname \ in
  word% field Quit>flags    \ in
end-struct Quit%

$2012 gsos ReadGS

struct
  word% field Read>pCount        \ min 4
  word% field Read>refNum        \ in
  long% field Read>dataBuffer    \ in
  long% field Read>requestCount  \ in
  long% field Read>transferCount \ out
  word% field Read>cachePriority \ in
end-struct Read%

$2026 gsos ResetCacheGS

struct
  word% field ResetCache>pCount \ min 0
end-struct ResetCache%

$201f gsos SessionStatusGS

struct
  word% field SessionStatus>pCount \ min 1
  word% field SessionStatus>status \ out
end-struct SessionStatus%

$2018 gsos SetEOFGS

struct
  word% field SetEOF>pCount       \ min 3
  word% field SetEOF>refNum       \ in
  word% field SetEOF>base         \ in
  long% field SetEOF>displacement \ in
end-struct SetEOF%

$2005 gsos SetFileInfoGS

struct
  word% field SetFileInfo>pCount         \ min 2
  long% field SetFileInfo>pathname       \ in
  word% field SetFileInfo>access         \ in
  word% field SetFileInfo>fileType       \ in
  long% field SetFileInfo>auxType        \ out
  word% field SetFileInfo>reserved1      \ in
  quad% field SetFileInfo>createDataTime \ in
  quad% field SetFileInfo>modDateTime    \ in
  long% field SetFileInfo>optionList     \ in
  long% field SetFileInfo>reserved2      \ in
  long% field SetFileInfo>reserved3      \ in
  long% field SetFileInfo>reserved4      \ in
  long% field SetFileInfo>reserved5      \ in
end-struct SetFileInfo%

$201a gsos SetLevelGS

struct
  word% field SetLevel>pCount \ min 1
  word% field SetLevel>level  \ in
end-struct SetLevel%

$2016 gsos SetMarkGS

struct
  word% field SetMark>pCount       \ min 3
  word% field SetMark>refNum       \ in
  word% field SetMark>base         \ in
  long% field SetMark>displacement \ in
end-struct SetMark%

$2009 gsos SetPrefixGS

struct
  word% field SetPrefix>pCount    \ min 2
  word% field SetPrefix>prefixNum \ in
  long% field SetPrefix>prefix    \ in
end-struct SetPrefix%

$200c gsos SetSysPrefsGS

struct
  word% field SetSysPrefs>pCount      \ min 1
  word% field SetSysPrefs>preferences \ in
end-struct SetSysPrefs%

$2032 gsos UnbindIntGS

struct
  word% field UnbindInt>pCount \ min 1
  word% field UnbindInt>intNum \ in
end-struct UnbindInt%

$2008 gsos VolumeGS

struct
  word% field Volume>pCount      \ min 2
  long% field Volume>devName     \ in
  long% field Volume>volName     \ in
  long% field Volume>totalBlocks \ out
  long% field Volume>freeBlocks  \ out
  word% field Volume>fileSysID   \ out
  word% field Volume>blockSize   \ out
end-struct Volume%

$2013 gsos WriteGS

struct
  word% field Write>pCount        \ min 4
  word% field Write>refNum        \ in
  long% field Write>dataBuffer    \ in
  long% field Write>requestCount  \ in
  long% field Write>transferCount \ out
  word% field Write>cachePriority \ in
end-struct Write%

( error codes )

$01 constant badSystemCall
$04 constant invalidPcount
$07 constant gsosActive
$10 constant devNotFound
$11 constant invalidDevNum
$20 constant drvrBadReq
$21 constant drvrBadCode
$22 constant drvrBadParm
$23 constant drvrNotOpen
$24 constant drvrPriorOpen
$25 constant irqTableFull
$26 constant drvrNoResrc
$27 constant drvrIOError
$28 constant drvrNoDevice
$29 constant drvrBusy
$2b constant drvrWrtProt
$2c constant drvrBadCount
$2d constant drvrBadBlock
$2e constant drvrDiskSwitch
$2f constant drvrOffLine
$40 constant badPathSyntax
$43 constant invalidRefNum
$44 constant pathNotFound
$45 constant volNotFound
$46 constant fileNotFound
$47 constant dupPathname
$48 constant volumeFull
$49 constant volDirFull
$4a constant badFileFormat
$4b constant badStoreType
$4c constant eofEncountered
$4d constant outOfRange
$4e constant invalidAccess
$4f constant buffTooSmall
$50 constant fileBusy
$51 constant dirError
$52 constant unknownVol
$53 constant paramRangeErr
$54 constant outOfMem
$57 constant dupVolume
$58 constant notBlockDev
$59 constant invalidLevel
$5a constant damagedBitMap
$5b constant badPathNames
$5c constant notSystemFile
$5d constant osUnsupported
$5f constant stackOverflow
$60 constant dataUnavail
$61 constant endOfDir
$62 constant invalidClass
$63 constant resForkNotFound
$64 constant invalidFSTID
$67 constant devNameErr
$70 constant resExistsErr
$71 constant resAddErr

